﻿using UnityEngine;
using System.Collections;

public class moverFondo : MonoBehaviour {
	public float velocidadMovimiento;
	public float tamanioFondo;

	private Vector3 posicionInicial;
	// Use this for initialization
	void Start () {
		posicionInicial=transform.position;
	}
	
	// Update is called once per frame
	void Update () {
		float nuevaPos = Mathf.Repeat(Time.time * velocidadMovimiento, tamanioFondo);
		transform.position = posicionInicial + Vector3.right * nuevaPos;
	}
}
